from common.SysConfig import SysConfig
from common.WordCache import WordCache
#系统配置
sysConfig=SysConfig()
# 当前读取缓存
nowWordCache = WordCache()
#初始化常量
def initConstant():
    sysConfig.filterWordsPath = "C:\\Users\\zhouyongbo\\Desktop\\采集软件\\品牌关键词.txt"
    sysConfig.undonePathExcel = ["C:\\Users\\zhouyongbo\\Desktop\\采集软件\\布艺家饰-餐桌布艺-餐垫1.xls",
                                 "C:\\Users\\zhouyongbo\\Desktop\\采集软件\\布艺家饰-餐桌布艺-餐垫2.xls"]
    sysConfig.loadFilterPath()
    loadWords()
    print("初始化完成")
#初始化界面
appWindows = None

def setAppWindows(appWindow=None):
    global appWindows
    appWindows = appWindow

# 加载关键词
def loadWords():
    nowWordCache.clear()
    undonePathExcels = sysConfig.undonePathExcel
    if undonePathExcels==None or len(undonePathExcels)==0:
        return
    undonePathExcel = sysConfig.undonePathExcel.pop(0);
    nowWordCache.filePath=undonePathExcel
    nowWordCache.loadFileExcel()

if __name__ == '__main__':
    initConstant()


